<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="">
	<meta name="author" content="">

	<title>选课系统-选课时间管理</title>

	<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
	<!-- Custom styles for this template -->
	<link th:href="@{/css/dashboard.css}" rel="stylesheet">

	<script th:src="@{/js/bootstrap.min.js}"></script>
	<script type="text/javascript" th:src="@{/js/jquery-3.2.1.js}"></script>
	<script type="text/javascript">

		function postTime(){
			$.ajax({
				type: "POST",
				url:"/admin/selectManage",
				data:{'startTime':$("#startTime").val(),'endTime':$("#endTime").val()},
				success:function (data) {
					console.log(data);
					var form=$("#timeInput");
					form.empty();//清空tbody中原有内容
					var msg=$("#msg");
					msg.append(
							`<b>${data}</b>`
					)

				},
				error : function(e){
					console.log(e.status);
					console.log(e.responseText);
				}
			});
		}
	</script>


</head>

<body>
<div th:replace="~{commons::topbar}"></div>

	<div class="container-fluid">
		<div class="row">
			<div th:replace="~{commons::sidebar(active='selectmanage')}"></div>

			<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
				<div id="msg"></div>
				<div id="timeInput">
					<label>选课开始时间</label>
					<input type="text" class="form-control" id="startTime" placeholder="yyyy-MM-dd HH:mm:ss" th:value="${startTime}">
					<label>选课结束时间</label>
					<input type="text" class="form-control" id="endTime" placeholder="yyyy-MM-dd HH:mm:ss" th:value="${endTime}">
					<br>
					<a class="btn btn-sm btn-success" th:href="|javascript:postTime()|">提交</a>
				</div>


			</main>
		</div>
	</div>



</body>

</html>